home *** CD-ROM | disk | FTP | other *** search
- function WSbutton()
- {
- this.init();
- }
- WSbutton.prototype = new MovieClip();
- Object.registerClass("wsbutton",WSbutton);
- b = WSbutton.prototype;
- b.init = function()
- {
- var _loc1_ = this;
- if(_loc1_.aktiv)
- {
- _loc1_.gotoAndStop(_loc1_.labelTxt + "_over");
- _loc1_.enabled = false;
- }
- else
- {
- _loc1_.gotoAndStop(_loc1_.labelTxt);
- }
- _loc1_.ursprungX = _loc1_._x;
- _loc1_.ursprungY = _loc1_._y;
- _loc1_.abstandX = _loc1_._width / 2;
- _loc1_.abstandY = _loc1_._height / 2;
- _loc1_.minX = _loc1_.ursprungX - _loc1_.abstandX;
- _loc1_.maxX = _loc1_.ursprungX + _loc1_.abstandX;
- _loc1_.minY = _loc1_.ursprungY - _loc1_.abstandY;
- _loc1_.maxY = _loc1_.ursprungY + _loc1_.abstandY;
- _loc1_.imBereich = 0;
- _loc1_.magnetOut = 3;
- _loc1_.tiefe = _loc1_.getDepth();
- };
- b.onRollOver = function()
- {
- var _loc1_ = this;
- _loc1_.gotoAndStop(_loc1_.labelTxt + "_over");
- if(!_loc1_.single)
- {
- _loc1_.swapDepths(100);
- }
- };
- b.onRollOut = function()
- {
- var _loc1_ = this;
- _loc1_.gotoAndStop(_loc1_.labelTxt);
- if(!_loc1_.single)
- {
- _loc1_.swapDepths(_loc1_.tiefe);
- }
- };
- b.onPressEvent = function()
- {
- var _loc1_ = this;
- delete _loc1_.onEnterFrame;
- if(!_loc1_.single)
- {
- var _loc3_ = _root.aktiverBereich;
- var _loc2_ = "b_" + _loc3_;
- _loc1_._parent[_loc2_].gotoAndStop(_loc3_);
- _loc1_._parent[_loc2_].aktiv = false;
- _loc1_._parent[_loc2_].enabled = true;
- _root.aktiverBereich = _loc1_.labelTxt;
- _loc1_.aktiv = true;
- }
- _loc1_.gotoAndStop(_loc1_.labelTxt + "_over");
- _loc1_.enabled = false;
- _loc1_.swapDepths(_loc1_.tiefe);
- _loc1_.moveOut();
- };
- b.onMouseMove = function()
- {
- if(!this.aktiv)
- {
- this.checkBorder();
- }
- };
- b.checkBorder = function()
- {
- var _loc1_ = this;
- var _loc2_ = _root;
- if(_loc2_._xmouse > _loc1_.minX && _loc2_._xmouse < _loc1_.maxX && _loc2_._ymouse > _loc1_.minY && _loc2_._ymouse < _loc1_.maxY)
- {
- _loc1_.moveIn();
- }
- else
- {
- _loc1_.moveOut();
- }
- };
- b.moveIn = function()
- {
- var _loc1_ = this;
- _loc1_.imBereich = 1;
- _loc1_.onEnterFrame = function()
- {
- var _loc1_ = this;
- _loc1_.neuX = _root._xmouse;
- _loc1_.neuY = _root._ymouse;
- _loc1_.wegX = _loc1_.neuX - _loc1_._x;
- _loc1_.wegY = _loc1_.neuY - _loc1_._y;
- _loc1_._x += Math.round(_loc1_.wegX / _loc1_.magnet);
- _loc1_._y += Math.round(_loc1_.wegY / _loc1_.magnet);
- if(_loc1_.wegX == _loc1_.wegX_alt && _loc1_.wegY == _loc1_.wegY_alt)
- {
- delete _loc1_.onEnterFrame;
- }
- _loc1_.wegX_alt = _loc1_.wegX;
- _loc1_.wegY_alt = _loc1_.wegY;
- };
- };
- b.moveOut = function()
- {
- var _loc1_ = this;
- if(_loc1_.imBereich == 1)
- {
- _loc1_.imBereich = 0;
- _loc1_.onEnterFrame = function()
- {
- var _loc1_ = this;
- _loc1_.neuX = _loc1_.ursprungX;
- _loc1_.neuY = _loc1_.ursprungY;
- _loc1_.wegX = _loc1_.neuX - _loc1_._x;
- _loc1_.wegY = _loc1_.neuY - _loc1_._y;
- _loc1_._x += Math.round(_loc1_.wegX / _loc1_.magnetOut);
- _loc1_._y += Math.round(_loc1_.wegY / _loc1_.magnetOut);
- if(_loc1_.wegX == _loc1_.wegX_alt && _loc1_.wegY == _loc1_.wegY_alt)
- {
- _loc1_._x = _loc1_.ursprungX;
- _loc1_._y = _loc1_.ursprungY;
- delete _loc1_.onEnterFrame;
- }
- _loc1_.wegX_alt = _loc1_.wegX;
- _loc1_.wegY_alt = _loc1_.wegY;
- };
- }
- };
-